#!/bin/awk -f

# ./grade.awk age=10 testdata/grade.txt 

# 写成文件的好处是可以自由添加注释

BEGIN {
    print "Student Date Member No. Grade Age Points Max"
    print "============================================"
}

# 没加{} 则会打印所有行，即使后面的if 加了 {} ????????????????
{total+=$6}
{ if($5<age) print $1 }

END {
    print "total points:" total
    print "avg: " total/NR
}